package com.orhonit.ipb.portal.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Select;

import com.orhonit.ipb.portal.entity.TbPartyOrgCatalog;
import com.orhonit.ipb.security.common.mapper.CommonMapper;

import tk.mybatis.mapper.common.Mapper;

/**
 * 党组织目录
 * 
 * @author caodw
 * @email caodw@qq.com
 * @version 2018-04-23 11:25:03
 */
public interface TbPartyOrgCatalogMapper extends CommonMapper<TbPartyOrgCatalog> {
	/**
	 * 通过组织编码查找下级所有组织
	 * @param upPOrganizationCode
	 * @return List<TbPartyOrgCatalog>
	 */
	List<TbPartyOrgCatalog> getTbPartyOrgCatalogByparentId(String upPOrganizationCode);
	/**
	 * 通过组织id查找上级组织id
	 * @param DeptId
	 * @return
	 */
	String getTbPartyOrgCatalogByDeptId(String DeptId);
	/**
	 * 通过组织id查找组织名称
	 * @param DeptId
	 * @return
	 */
	String getDeptNameByDeptId(String DeptId);
	
	@Select("select p_organization_code from tb_party_org_catalog where up_p_organization_code = #{integer}")
	List<String> getIdFromParent(String integer);
	/**
	 * 查找最高组织
	 * @return
	 */
	TbPartyOrgCatalog getrootId();
	
	
}
